$(function() {
	$.include("web/js/jquery/jquery.getscrollbarwidth.js");
	$.include("web/css/resume.css");
	$.get("web/html/resume.html", function(data) {
		$("#content .content").append(data);
		winresize();
	});

	var winresize = function() {
		$("#content").height(document.body.clientHeight - 30);
		$(document.body).css('min-width', 750 + $.getScrollbarWidth());
	}
	$(window).resize(winresize);
	winresize();

	$("#topbar .text .down").click(function() {
		window.open("api/down.php");
	});
	$("#topbar .text .send").click(function() {
		var mail = $(".mail").val();
		if (mail.length == 0) {
			alert("请输入邮件地址");
			return false;
		}
		$.getJSON("api/send.php", {
			"t" : mail
		}, function(json) {
			if (json.r == true) {
				alert("发送成功");
			} else if (json.r == false && json.e == 1) {
				alert("请输入邮件地址");
			} else if (json.r == false && json.e == 2) {
				alert("邮件地址错误");
			} else {
				alert("未知错误");
			}
		});
	});
});
